package hn.cch.spring_boot_security_rest.wrapper;

import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

public class ApiServletOutputStream extends ServletOutputStream {

    private ByteArrayOutputStream baos = null;

    public ApiServletOutputStream(ByteArrayOutputStream baos) {
        this.baos = baos;
    }

    @Override
    public boolean isReady() {
        return false;
    }

    @Override
    public void setWriteListener(WriteListener writeListener) {

    }

    @Override
    public void write(int b) throws IOException {
        baos.write(b);
    }
}
